package com.bw.wxy.mvp.view.pople.adapter;

import android.widget.ImageView;

import androidx.annotation.Nullable;

import com.bw.wxy.R;
import com.bw.wxy.common.GlideUtils;
import com.bw.wxy.mvp.model.entity.FollowEntity;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.List;

public class FollowNewsAdapter extends BaseQuickAdapter<FollowEntity.Values, BaseViewHolder> {
    public FollowNewsAdapter( @Nullable List<FollowEntity.Values> data) {
        super(R.layout.item_follow, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, FollowEntity.Values item) {
        helper.setText(R.id.follow_item_name_tv,item.author_name);
        helper.setText(R.id.follow_item_value_tv,item.author_attestation);
        helper.setText(R.id.follow_item_title,item.news_title);
        helper.setText(R.id.follow_item_time,""+item.news_time);
        ImageView headImg = helper.getView(R.id.follow_item_head_img);
        ImageView img = helper.getView(R.id.follow_item_img);
        GlideUtils.getInstance().loadCircleImg(item.author_img,headImg);
        GlideUtils.getInstance().loadMatchImg(item.medias.get(0).media_url,img);
    }
}

